const express = require('express')
const path = require('path')

const app = express()

app.use(express.static(path.join(__dirname, 'public')))

app.get('/', (req, res) => {
  res.sendFile(__dirname + 'public/index.html')
})

const server = app.listen(3050, () => {
  const port = server.address().port
  //  服务器IP地址为127.0.0.1 端口为3050
  console.log('server is running at:' + port)
})